package org.example.serviceImpl;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.example.mapper.GoodsMapper;
import org.example.pojo.Goods;
import org.example.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *@ClassName: GoodServiceImpl
 *@Author: CJ
 *@Date: 2021-9-5 15:28
 */
@Service
public class GoodServiceImpl implements GoodService {

    @Autowired
    private GoodsMapper goodsMapper;

    @DS(value = "slave")
    @Override
    public Goods selectOneGoods(Long goodsid) {
        return goodsMapper.selectByPrimaryKey(goodsid);
    }

    @Override
    public int addGoods(Goods goods) {
        return goodsMapper.insertSelective(goods);
    }
}
